package club.xinghe.biz;

import club.xinghe.dao.YxDao;
import club.xinghe.entity.Yx;
import club.xinghe.util.SqlSessionFactoryUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.ArrayList;
import java.util.List;

/**
 * 说明:对院系进行操作的业务
 *
 * @姚文斌
 * @create 2019-09-28 下午 6:23
 */
public class YxBiz {
    /**
     * 说明：查找所有的院系
     * 姚家乐
     * @return
     */
    public List<Yx> showYx(){
        SqlSession session = SqlSessionFactoryUtil.getSqlSession();
        List<Yx> yxList = new ArrayList<>();
        try {
            YxDao yxDao = session.getMapper(YxDao.class);
            yxList = yxDao.showYx();
        }catch (Exception e){
            e.printStackTrace();
        }finally {
            session.close();
        }
        return yxList;
    }
}
